﻿using furion.blog.Domain.MySQL;
using furion.blog.Domain.Query.Message;
using furion.blog.Domain.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.IRepositories
{
    public interface IMessageRepository
    {

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<bool> Save(Message model);

        /// <summary>
        /// 批量保存
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<bool> SaveBatch(List<Message> data);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<bool> Update(Message model);

        /// <summary>
        /// 设置已读
        /// </summary>
        /// <param name="id">信息id</param>
        /// <param name="toUser">接收人</param>
        /// <returns></returns>
        Task<bool> Read(long id,long toUser);

        /// <summary>
        /// 统计数量
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<long> Count(MessageDetailQuery query);

        /// <summary>
        /// 信息分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<PageVO> List(MessageListQuery query);

        /// <summary>
        /// 设置为已打开
        /// </summary>
        /// <param name="messageId"></param>
        /// <param name="memberId"></param>
        /// <returns></returns>
        Task<bool> Open(long messageId,long memberId);

        /// <summary>
        /// 通过id查找
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Message> FindById(long id);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <param name="memberId"></param>
        /// <returns></returns>
        Task<bool> Del(long id,long memberId);

    }
}
